﻿using System;
using System.Collections.Generic;
using System.Configuration;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using LynxWiki.DomainModel;
using IronWiki;

namespace IronWiki.Tests
{
    [TestClass]
    public class UnitTest1
    {
        [TestInitialize]
        public void TestSetup()
        {
            WikiRoot.RootDirectory = ConfigurationManager.AppSettings["WikiRoot"];
        }

        [TestMethod]
        public void TestMethod1()
        {
            // need to override _luceneDir in LuceneSearch for this to work
            WikiSearch ws = new WikiSearch();
            List<WikiSearchData> sdl = ws.SearchCreator("jwd",5);
            Assert.AreEqual(sdl.Count, 5);
        }

        [TestMethod]
        public void TestGetTopicsWithProperty()
        {
            WikiSearch ws = new WikiSearch();
            List<TopicVersion> tvl = new List<TopicVersion>();
            tvl = ws.GetTopicsWithProperty("Summary");
            Assert.IsNotNull(tvl);
            Assert.IsTrue(tvl.Count > 0);
        }
    }
}
